package com.yan;

import com.yan.base.ApiStatInfo;
import com.yan.handlers.AlertHandler;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yanheng
 * @data 2019/12/31 17:01
 */
public class Alert {
    private List<AlertHandler> alertHandlers = new ArrayList<>();

    public void addAlertHandler(AlertHandler alertHandler) {
        this.alertHandlers.add(alertHandler);
    }

    public void check(ApiStatInfo apiStatInfo){
        for (AlertHandler alertHandler : alertHandlers) {
            alertHandler.check(apiStatInfo);
        }
    }
}
